﻿Imports System.Runtime.CompilerServices

Module Extension

    <Extension()> _
    Public Function Substring(ByVal [Me] As String, ByVal LeftChar As String, ByVal RightChar As String, Optional ByVal startIndex As Integer = 0) As String
        Dim posLeft = [Me].IndexOf(LeftChar, startIndex)
        Dim posRight = [Me].IndexOf(RightChar, posLeft + 1)
        Return [Me].Substring(posLeft + LeftChar.Length, posRight - posLeft - LeftChar.Length)
    End Function

End Module